package com.dk.service.impl;

import com.dk.mapper.TabChangeImgMapper;
import com.dk.pojo.TabChangeImg;
import com.dk.service.CarouselService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 轮播图
 */

@Service
public class CarouselServiceImpl implements CarouselService {
    @Autowired
    TabChangeImgMapper tabChangeImgMapper;
    @Override
    public List<TabChangeImg> getInfo() {
        return tabChangeImgMapper.selectByExample(null);
    }

    @Override
    public int insertInfo(TabChangeImg changeImg) {
        return tabChangeImgMapper.insertSelective(changeImg);
    }

    @Override
    public TabChangeImg getInfoById(Integer id) {
        return tabChangeImgMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateCarousel(TabChangeImg changeImg) {
        return tabChangeImgMapper.updateByPrimaryKeySelective(changeImg);
    }

    @Override
    public int deleteCarouselById(Integer id) {
        return tabChangeImgMapper.deleteByPrimaryKey(id);
    }
}
